<?php
	include_once('../sys/sys.php');
	header('Content-Type: application/json; charset=utf-8');
	$action = $_GET['action'];
	$tid = $_GET['tid'];
	
	if(!is_numeric($tid) || $tid < 0){
		//show_normal_mesR('TAG ID错误','TAG ID错误','TAG查询');
	}
	//$tid = 977;
	//开始获取该ID下的图片
	$DB->build_query(array(
			'select' 	=> '*',
			'from'		=> '178_photos',
			'where'		=>	'uid=' . $tid,
	));
	$qid = $DB->exec_query();
	$pics = '';
	
	$i = 0;
	$str = '{"dat": [';
	while ($row = $DB->fetch_row($qid)) {
		//获取名称以及
		$str .= '{"nName": "' .trim($row['name']). '","id": "' . $row['url'] . '"},';
		$i++;
	}
	$str = substr($str,0,strlen($str) - 1);
	$str .= "]}";
	
	echo $str;
	//ob_end_flush();
	//echo "</BR>";
	//echo '{"dat": [{"nName": "第1卷 ","id": "http://xs.178.com/81/318/318.txt"},{"nName": "第2卷","id": "http://xs.178.com/81/319/319.txt"},{"nName": "第3卷","id": "http://xs.178.com/81/3068/3068.txt"},{"nName": "第3卷","id": "http://xs.178.com/81/3068/3068.txt"},{"nName": "第3卷","id": "http://xs.178.com/81/3068/3068.txt"},{"nName": "第4卷","id": "http://xs.178.com/81/3257/3257.txt"},{"nName": "第1卷 ","id": "http://xs.178.com/81/318/318.txt"},{"nName": "第2卷","id": "http://xs.178.com/81/319/319.txt"},{"nName": "第3卷","id": "http://xs.178.com/81/3068/3068.txt"},{"nName": "第4卷","id": "http://xs.178.com/81/3257/3257.txt"},{"nName": "第五卷","id": "http://xs.178.com/81/3455/3455.txt"}]}';
?>